package com.card.hwatt.entity;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.FetchType;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;

/**
 * 用户
 * 
 * @author Administrator
 * 
 */
@Entity
@Table(name = "T_User")
public class User {

	@Id
	@GeneratedValue(generator = "generator")
	@GenericGenerator(name = "generator", strategy = "assigned")
	@Column(name = "`UserID`", length = 36)
	@Type(type = "uuid-char")
	public UUID id;

	@OneToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "EmployeeID")
	public Employee employee;

	/**
	 * s 密码
	 */
	@Column(name = "`Password`", nullable = true, length = 32)
	public String password;

	/**
	 * 是否为考勤员
	 */
	@Column(name = "`IsAdmin`", nullable = true, columnDefinition = "BIT", length = 1)
	public boolean isAdmin;
}
